package 华为练习;

import java.util.Scanner;

/**
 * Created by hest0 on 2017/7/12.
 */
public class 读英文数字 {

    static String[] gewei = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
    static String[] shiji = {"zero", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"};
    static String[] shiwei = {"zero", "ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"};

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String line = sc.nextLine();
            if (isRightNum(line)) {
                System.out.println(readNum(line).replaceAll("zero hundred and ", ""));
            } else {
                System.out.println("error");
            }
        }
        sc.close();
    }

    private static String readNum(String line) {
        if (line.length() <= 3) {
            return readBai(line);
        } else if (line.length() >= 4 && line.length() <= 6) {
            String bai = line.substring(line.length() - 3);
            String qian = line.substring(0, line.length() - 3);
            return readBai(qian) + " thousand " + readBai(bai);
        } else if (line.length() >= 7 && line.length() <= 9) {
            String bai = line.substring(line.length() - 3);
            String qian = line.substring(line.length() - 6, line.length() - 3);
            String baiwan = line.substring(0, line.length() - 6);
            return readBai(baiwan) + " million " + readBai(qian) + " thousand " + readBai(bai);
        }
        return null;
    }

    private static String readBai(String line) {
        if (line.length() == 1) {
            int n = Integer.parseInt(line);
            return gewei[n];
        } else if (line.length() == 2) {
            if (Integer.parseInt(line) >= 11 && Integer.parseInt(line) <= 19) {
                return shiji[Integer.parseInt(line) - 10];
            } else {
                int g = Integer.parseInt(String.valueOf(line.charAt(1)));
                int s = Integer.parseInt(String.valueOf(line.charAt(0)));
                if (g != 0) {
                    return shiwei[s] + " " + gewei[g];
                } else if (g == 0) {
                    return shiwei[s];
                }
            }
        } else if (line.length() == 3) {
            int g = Integer.parseInt(String.valueOf(line.charAt(2)));
            int s = Integer.parseInt(String.valueOf(line.charAt(1)));
            int b = Integer.parseInt(String.valueOf(line.charAt(0)));

            if (s == 1) {
                if (g == 0) {
                    return gewei[b] + " hundred and ten";
                } else if (g >= 1 && g <= 9) {
                    return gewei[b] + " hundred and " + shiji[g];
                }
            } else {
                if (s == 0 && g != 0) {
                    return gewei[b] + " hundred and " + gewei[g];
                } else if (s != 0 && g == 0) {
                    return gewei[b] + " hundred and " + shiwei[s];
                } else if (s != 0 && g != 0) {
                    return gewei[b] + " hundred and " + shiwei[s] + " " + gewei[g];
                } else if (s == 0 && g == 0) {
                    return gewei[b] + " hundred";
                }
            }
        }
        return null;
    }

    private static boolean isRightNum(String line) {
        if (line.contains("."))
            return false;
        else if (line.length() > 9)
            return false;
        return true;
    }

}
